package com.gxa.service.impl;

import com.gxa.mapper.RoleMapper;
import com.gxa.pojo.Role;
import com.gxa.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleMapper roleMapper;

    /**
     * 根据用户id 查找角色
     * @param userId
     * @return
     */
    @Override
    public List<Role> findRoleByUserId(Integer userId) {
        return roleMapper.findByUserId2(userId);
    }

    /**
     * 按条件查找角色
     * @param role
     * @return
     */
    @Override
    public List<Role> findRoleByParam(Role role) {
        return roleMapper.findRoleByParam(new Role());
    }
}
